package com.atguigu.srb.sms.util;

import lombok.Data;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

//@Component
@Data
@Deprecated
//@ConfigurationProperties(prefix = "ronglianyun.sms")
public class SmsProperties implements BeanPostProcessor {
    private String serverIp;
    private String serverPort;
    private String accountSid;
    private String accountToken;
    private String appId;
    private String templateCode;

    public static String SERVER_IP;
    public static String SERVER_PORT;
    public static String ACCOUNT_SID;
    public static String ACCOUNT_TOKEN;
    public static String APP_ID;
    public static String TEMPLATE_CODE;

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        SERVER_IP = serverIp;
        SERVER_PORT = serverPort;
        ACCOUNT_SID = accountSid;
        ACCOUNT_TOKEN = accountToken;
        APP_ID = appId;
        TEMPLATE_CODE = templateCode;
        return bean;
    }
}
